package com.qf.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class AroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {

        try {
            System.out.println("前置通知");
            Object proceed = invocation.proceed();
            System.out.println("后置通知");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("异常通知");
        } finally {
            System.out.println("最终通知");
        }
        return null;
    }
}
